package com.example.demo.arithmetic.algorithm.recursion;

/**
 * 杨辉三角
 */
public class PascalTriangle {
    public static void main(String[] args) {
        System.out.println(element(4, 2));
    }

    private static int element(int i, int j) {
        if (j == 0 || i == j) {
            return 1;
        }
        return element(i - 1, j - 1) + element(i - 1, j);
    }

}
